﻿# ipy.exe for Crigate
import clr
import System
import Misuzilla.Crigate

from Misuzilla.Crigate               import ConsoleHandler, Console, Context
from Misuzilla.Crigate.Configuration import IConfiguration, ICustomConfiguration, ConfigurationPropertyInfo
from Misuzilla.Crigate.Scripting     import DLRIntegrationHandler, DLRBasicConfiguration, DLRContextHelper, IpyContext

console = Misuzilla.Crigate.Console()
console.Initialize(CurrentSession)
console.Attach("#ipy", IpyContext)
CurrentSession.HandlerLoader.GetHandler[DLRIntegrationHandler]().BeforeUnload += lambda sender, e: console.Detach()
